package com.hnkywl.sts.action.flow.endState;

import com.hnkywl.sts.entity.organ.Lj;
import com.hnkywl.sts.service.organ.LjwhService;
import com.hnkywl.sts.util.ApplicationInstance;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;

/**
 * Created with IntelliJ IDEA.
 * User: jerry
 * Date: 13-6-2
 * Time: 上午9:45
 * To change this template use File | Settings | File Templates.
 */
public class EndLjState implements EventListener {
    @Override
    public void notify(EventListenerExecution execution) throws Exception {
        // 改变状态  ytj--->ysp
        LjwhService ljwhService = ApplicationInstance.createLjwhService();
        Lj lj = ljwhService.findLjDetailByProcessInstance(execution.getProcessInstance().getId());
        lj.setZt("ysp");
        ljwhService.save(lj);
    }
}
